<include file="public:top" />
<!--网站设置-->
<body class="body">
<style type="text/css">
    .red {color: #FF5722!important;}
    .green {color: #5FB878!important;}
</style>
<fieldset class="layui-elem-field layui-field-title" style="margin-top:0px;">
    <legend>{$menuid|getmenuname}</legend>
</fieldset>
<form class="layui-form layui-form-pane" action="">
    <input type="hidden" name="g" value="admin" />
    <input type="hidden" name="m" value="view" />
    <table class="layui-table">
        <colgroup>
            <col width="90">
            <col width="250">
            <col width="150">
            <col width="">
            <col width="120">
            <col width="120">
           
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>模板截图</th>
            <th>模板名称</th>
            <th>模板文件夹</th>
            <th>模板作者</th>
            <th>版本</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody id="navList">
        <volist name="template_list" id="val">
            <tr>
              <td align="center"><span><a href="{$val.preview}" target="_blank"><img src="{$val.preview}" width="30" height="40" style="border:1px #E4E4E4 solid;" /></a></span></td>
              <td><span>{$val.name}</span></td>
              <td><span>{$val.dirname}</span></td>
              <td><span>{$val.author}</span></td>
              <td><span>{$val.version}</span></td>
              <td><if condition="$def_tpl eq $val['dirname']"><span class="green">当前模板</span><else/><a href="{:U('view/tpl',array('dirname'=>$val['dirname'],'menuid'=>$menuid))}" id="upbtn">设为默认</a></if></td>
          </tr>
        </volist>
        </tbody>
    </table>
</form>

<script type="text/javascript" src="__PUBLIC__/admin/layui/layui.js"></script>
<script>
//Demo
layui.use(['layer','jquery','form','element','table'], function () {
   // 操作对象
    var layer = layui.layer,$ = layui.jquery,form = layui.form, element = layui.element,table = layui.table;
    //删除操作
    $(function(){
        $("#upbtn").click(function() {
            $.post("{:U('view/tpl',array('dirname'=>$val['dirname'],'menuid'=>$menuid))}",function(res){
                layer.msg("设置成功",{time:1800});
            });
        });
    });
});
</script>
</body>
</html>